﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Common;
using DataAccess;

namespace BusinessLogic
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MenusService" in code, svc and config file together.
    /// <summary>
    /// This service contains methods which get data regarding menus from the
    /// Menus and MenuRoles tables in the database.
    /// </summary>
    public class MenusService : IMenusService
    {
        /// <summary>
        /// A method which is used to get the Main Menu Items for a user
        /// </summary>
        /// <param name="username">The username for whom the Main Menu Items are going to be retreived</param>
        /// <returns>A list of menu items which will be retreived according to username</returns>
        public IEnumerable<Menu> GetMainMenusByUsername(string username)
        {
            return new MenusRepository().GetMainMenusByUsername(username);
        }

        /// <summary>
        /// A method which is used to get the Main Menu Items for a particular role
        /// </summary>
        /// <param name="roleId">The ID of the role for which the Main Menu Items are going to be retreived</param>
        /// <returns>A list of menu items which will be retreived according to the role ID</returns>
        public IEnumerable<Menu> GetMainMenusByID(int roleId)
        {
            return new MenusRepository().GetMainMenusByID(roleId);
        }
    }
}
